package com.twb.core.jackson;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

/**
 * jackson配置属性
 * @author dsy-pc
 *
 */
@Component
@ConfigurationProperties(
  prefix = "twb.jackson"
)
public class JacksonConfigProperties {
	
	private boolean enabled = false;
	
	private String dateFormat="yyyy-MM-dd";
	private String timeFormat="HH:mm:ss";
	private String dateTimeFormat="yyyy-MM-dd HH:mm:ss";
	private String timeZone="GMT+8";
	/**
	 * 不输出为空的字段
	 */
	private String defaultPropertyInclusion="NON_NULL";
	/**
	 * 格式化输出
	 */
	private Boolean indentOutput = true;
	
	/**
	 * 忽略无法转换的对象
	 */
	private Boolean failOnEmptyBeans = true;
	public boolean isEnabled() {
		return enabled;
	}
	public void setEnabled(boolean enabled) {
		this.enabled = enabled;
	}
	public String getDateFormat() {
		return dateFormat;
	}
	public void setDateFormat(String dateFormat) {
		this.dateFormat = dateFormat;
	}
	
	public String getTimeFormat() {
		return timeFormat;
	}
	public void setTimeFormat(String timeFormat) {
		this.timeFormat = timeFormat;
	}
	public String getDateTimeFormat() {
		return dateTimeFormat;
	}
	public void setDateTimeFormat(String dateTimeFormat) {
		this.dateTimeFormat = dateTimeFormat;
	}
	public String getTimeZone() {
		return timeZone;
	}
	public void setTimeZone(String timeZone) {
		this.timeZone = timeZone;
	}
	public String getDefaultPropertyInclusion() {
		return defaultPropertyInclusion;
	}
	public void setDefaultPropertyInclusion(String defaultPropertyInclusion) {
		this.defaultPropertyInclusion = defaultPropertyInclusion;
	}
	public boolean isIndentOutput() {
		return indentOutput;
	}
	public void setIndentOutput(boolean indentOutput) {
		this.indentOutput = indentOutput;
	}
	public boolean isFailOnEmptyBeans() {
		return failOnEmptyBeans;
	}
	public void setFailOnEmptyBeans(boolean failOnEmptyBeans) {
		this.failOnEmptyBeans = failOnEmptyBeans;
	}
	public Boolean getIndentOutput() {
		return indentOutput;
	}
	public void setIndentOutput(Boolean indentOutput) {
		this.indentOutput = indentOutput;
	}
	public Boolean getFailOnEmptyBeans() {
		return failOnEmptyBeans;
	}
	public void setFailOnEmptyBeans(Boolean failOnEmptyBeans) {
		this.failOnEmptyBeans = failOnEmptyBeans;
	}
}
